package com.zkk.tankgame03;

import javax.swing.*;

public class ZkkTankGame02 extends JFrame {

    //定义MyPanel
    MyPanel mp = null;
    public static void main(String[] args) {

        ZkkTankGame02 zkkTankGame01 = new ZkkTankGame02();
    }
    public ZkkTankGame02(){
        mp = new MyPanel();
        //将mp放入到Thread，并启动
        Thread thread = new Thread(mp);
        thread.start();
        this.add(mp);//添加面板（即绘图区域）这个控件
        this.setSize(1000,750);
        this.addKeyListener(mp);//让JFrame监听mp的键盘事件
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        this.setVisible(true);
    }
}
